// 当前这个模块的作用：对所有的API接口进行统一的管理
import request from "@/api/request";
import mockRequest from "@/api/mockRequest";

// 真实请求
export const reqGetRoomsList = (params)=> request({url:'/getRoomsData', method:'get', params});   //请求房间数据
export const reqGetRoomsSelectList = (classifyId)=> request({url:`/getRoomsSelectData?classifyId=${classifyId}`, method:'get'});   //按房型查房源，返回房源信息
export const reqCreateOrder = (params)=> request({url:'/createOrder', method:'post' ,params});    //提交申请入住订单
export const reqCreateUser = (params)=> request({url:'/createUser', method:'post', params});    //注册新用户
export const reqLoginUser = (params)=> request({url:'/loginUser', method:'post', params});    //用户登录
export const reqGetUserInfoOfToken = ()=> request({url:'/getUserInfoOfToken', method:'get'});    //根据token获取用户信息
export const reqGetUserOrdersOfToken = ()=> request({url:'/getUserOrders', method:'get'});    //根据token获取用户订单列表
export const reqUpdateOrderInfo = (params)=> request({url:'/updateOrderInfo', method:'put',params});    //根据orderId修改订单信息（修改name、phone）
export const reqUpdateUserBalance = (params)=> request({url:'/updateUserBalance', method:'put',params});    //根据Token为用户余额充值
export const reqPayOrder = (params)=> request({url:'/payOrder', method:'put',params});    //支付订单
export const reqCancelOrder = (params)=> request({url:'/cancelOrder', method:'put',params});    //取消订单、退款


// MOCK请求
// export const reqGetGoodsList = ()=> mockRequest({url: '/goodsListData', method: 'get'});
